/**
 * 数据表格组件样式 - DataTable
 * v1.0.0
 */

:root {
    --primary-color: #0066cc;
    --primary-hover: #0052a3;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --info-color: #1890ff;
    --text-primary: #262626;
    --text-secondary: #595959;
    --border-color: #d9d9d9;
    --bg-light: #fafafa;
    --bg-white: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============ 表格样式 ============ */

.table-wrapper {
    overflow-x: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
}

.table-header-row {
    background: linear-gradient(to right, #f0f2f5, #fafafa);
    border-bottom: 2px solid var(--border-color);
}

.table-header-cell {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.table-header-cell.sortable {
    cursor: pointer;
    transition: var(--transition);
}

.table-header-cell.sortable:hover {
    background-color: #e6e6e6;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-icon {
    font-size: 12px;
    opacity: 0.6;
    transition: var(--transition);
}

.table-header-cell.sortable:hover .sort-icon {
    opacity: 1;
}

.table-row {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.table-row:hover {
    background-color: #f9f9f9;
}

.table-row.even {
    background-color: #fafafa;
}

.table-row.odd {
    background-color: var(--bg-white);
}

.table-cell {
    padding: 14px 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============ 状态徽章 ============ */

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-active {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-offline {
    background-color: #fafafa;
    color: #595959;
    border: 1px solid #d9d9d9;
}

/* ============ 分页样式 ============ */

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--bg-light);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 120px;
    text-align: center;
}

/* ============ 响应式设计 ============ */

@media (max-width: 768px) {
    .table-wrapper {
        font-size: 12px;
    }

    .table-cell,
    .table-header-cell {
        padding: 10px 8px;
    }

    .pagination-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pagination-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .page-info {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .table-wrapper {
        font-size: 11px;
    }

    .table-cell,
    .table-header-cell {
        padding: 8px 6px;
    }

    .header-content {
        gap: 4px;
    }

    .sort-icon {
        font-size: 10px;
    }
}
